import {mapGetters, mapActions} from 'vuex'

const CurrentUser = {
    computed: {
        ...mapGetters([
            'isLogin',
            'user'
        ])
    },
    methods: {
        ...mapActions([
            'getCurrentUser',
            'updateUser'
        ])
    },
    async onShow() {
        if (await this.isLogin) {
            await this.getCurrentUser()//获取用户信息
        }
    }
}

export default CurrentUser
